
function SyncGetFileSize(remote_url)
	local socket=require "socket"
	local http=require"socket.http"
	local r,c,h = http.request {
		method = "HEAD",
		url = remote_url
	}
    if c~=200 then return 0 end
    return tonumber(h['content-length'])
end

local remote_file_size=SyncGetFileSize("http://docs.battlefire.cn/media/1.mp3")
print("file size",remote_file_size.." byte")